<% core = kinds_field[:core]; form = kinds_field[:form]; %>
<div class="kinds_super">
	<% first = 1
	   Kind.find_by_sql(["select super_kind_" + I18n.locale + 
			" from kinds where type_core = ? group by super_kind_" + I18n.locale, core.class.to_s]).each do |super_kind| %>
		<div rif="super_kind_<%= core.class.to_s + '_' + super_kind.super_kind(I18n.locale) %>" class="label_style super_kind super_kind<%= "_clicked" if first %>">
			<%= super_kind.super_kind(I18n.locale) %>					
		</div>
		<% first = nil%>
	<% end%>
</div>		
<div class="kind_from kind_to_from">
<% prec_kind = ""
   kinds = Kind.find_all_by_type_core(core.class.to_s, :order => "super_kind_" + I18n.locale + ",name_" + I18n.locale )
	kinds.each do |kind| 
	if !core.kinds.include?(kind) -%>
		<%= "</div>" if !prec_kind.blank? and prec_kind != kind.super_kind(I18n.locale) %>
		<%= "<div class='kind_super_div#{"_showed" if prec_kind.blank? }' id='super_kind_#{ core.class.to_s + '_' + kind.super_kind(I18n.locale)}' #{"style='display:none'" if prec_kind != ""}>" if prec_kind != kind.super_kind(I18n.locale) %>
	<div class="kind_div" rif="super_kind_<%= core.class.to_s + '_' + kind.super_kind(I18n.locale) %>" kind="<%= kind.id %>">		
		<div class="label_style kind_name"><%= kind.name(I18n.locale) -%></div>			
		<div class="label_style kind_add_remove">+</div>
		<div class="separator"><span></span></div>								
	</div>			
	<% prec_kind = kind.super_kind(I18n.locale) %>
<%	end 
end -%>
<%= "</div>" if prec_kind != ""%>
</div>
<div class="kind_to kind_to_from">
<% kinds.each do |kind|
	if core.kinds.include?(kind) -%>
	<div class="kind_div" rif="super_kind_<%= core.class.to_s + '_' + kind.super_kind(I18n.locale) %>" kind="<%= kind.id %>">		
		<div class="left label_style"><%= kind.name(I18n.locale) -%></div>			
		<div class="kind_add_remove label_style">-</div>
		<div class="separator"><span></span></div>								
	</div>
<%  end 
end -%>
</div>
<div class="separator"><span></span></div>
<%= form.hidden_field :kindsids, :maxlength => 30, :class=> "core_kinds_txt" %>